<template>
	<div class="header" >
		<!--<div class="left-sildebar" v-if="this.$store.state.gnlist.pcqh">-->
		<!-- <div class="left-sildebar"  v-bind:class="classObject"> -->
		<div  v-bind:class="{'left-sildebar':this.$store.state.gnlist.pcqh,'left-sildebar1':!this.$store.state.gnlist.pcqh}">
			<el-col>
				<el-menu :default-active="routerIndex" class="el-menu-vertical-demo" router unique-opened>
					<el-menu-item index="/home"><i class="el-icon-plus"></i>首页</el-menu-item>
					<!-- <el-menu-item index="/authority">权限管理</el-menu-item> -->
						<el-submenu  index="1">
							<template slot="title"><i class="el-icon-star-off"></i>行政模块</template>
							<el-menu-item index="/cost/xsbaoming" v-if="this.qxbtn.c001x">新生报名</el-menu-item>
							<!--<el-menu-item index="/educa/student" v-if="this.qxbtn.c002x">催缴补缴</el-menu-item>-->
							<el-menu-item index="/cost/payjl" v-if="this.qxbtn.c049x">缴费催缴</el-menu-item>
							<el-menu-item index="/cost/ddlb" >订单列表</el-menu-item>

							<!--<el-menu-item index="/admin/xsda" v-if="this.qxbtn.c003x">学生档案</el-menu-item>-->
							<el-menu-item index="/cost/xstf"  v-if="this.qxbtn.c004x">退费退学</el-menu-item>
							<!--<el-menu-item index="/cost/wptf"  v-if="this.qxbtn.c061x">物品退费</el-menu-item>-->
							<el-menu-item index="/admin/xszx" v-if="this.qxbtn.c062x">学生转校</el-menu-item>
							<el-menu-item index="/educa/msg"  v-if="this.qxbtn.c006x">发送通知</el-menu-item>
							<!--<el-menu-item index="/admin/pingjiasend" v-if="this.qxbtn.c007x">发起评价</el-menu-item>-->
							<el-menu-item index="/admin/pingjia" v-if="this.qxbtn.c008x">评价老师</el-menu-item>
							<!--<el-menu-item index="/cost/txxx" v-if="this.qxbtn.c047x">休课名单</el-menu-item>-->
						</el-submenu>
						
						<el-submenu index="2">
							<template slot="title"><i class="el-icon-document"></i>教务模块</template>
							<!--<el-menu-item index="/admin/yushebj" v-if="this.qxbtn.c009x">预设班级</el-menu-item>-->
							<!--<el-menu-item index="/educa/class" v-if="this.qxbtn.c048x">正式班级</el-menu-item>-->
							<el-menu-item index="/educa/jskb"  v-if="this.qxbtn.c010x">全校课表</el-menu-item>
							<el-menu-item index="/educa/lskb"  v-if="this.qxbtn.c011x">老师课表</el-menu-item>
							<el-menu-item index="/admin/bjjczy" v-if="this.qxbtn.c013x">作业设置</el-menu-item>
							<el-menu-item index="/educa/bklist" v-if="this.qxbtn.c014x">补课安排</el-menu-item>
							<el-menu-item index="/educa/xsdrexcelst" v-if="this.qxbtn.c046x">学生导入</el-menu-item>
						</el-submenu>
						
						<el-submenu  index="3">
							<template slot="title"><i class="el-icon-goods"></i>进销存模块</template>
							<el-menu-item index="/manage/jxcgl" v-if="this.qxbtn.c020x">教材库存</el-menu-item>
							<el-menu-item index="/manage/gdjxcgl" v-if="this.qxbtn.c021x">固定资产</el-menu-item>
							<el-menu-item index="/manage/bgypjxcgl" v-if="this.qxbtn.c022x">易耗品</el-menu-item>
							<el-menu-item index="/cost/kcsh" v-if="this.qxbtn.c064x">库存审核</el-menu-item>
							<el-menu-item index="/manage/cfhb" v-if="this.qxbtn.c065x">教材拆分合并</el-menu-item>
						</el-submenu>
						
						<el-submenu  index="4">
							<template slot="title"><i class="el-icon-setting"></i>基础设置</template>
							<el-menu-item index="/admin/zwqxsz" v-if="this.qxbtn.c030x">职位权限</el-menu-item>
							<el-menu-item index="/admin/person" v-if="this.qxbtn.c031x">人事设置</el-menu-item>
							<el-menu-item index="/admin/jiaoshi" v-if="this.qxbtn.c032x">教室设置</el-menu-item>
							<el-menu-item index="/admin/holidays" v-if="this.qxbtn.c033x">节假日设置</el-menu-item>
							<el-menu-item index="/admin/bqy" v-if="this.qxbtn.c034x">学生标签设置</el-menu-item>
							<el-menu-item index="/admin/xxjbsz" v-if="this.qxbtn.c035x">学校信息设置</el-menu-item>
							<el-menu-item index="/admin/xtcs" v-if="this.qxbtn.c036x">基础参数设置</el-menu-item>
							<el-menu-item index="/admin/xtpz" v-if="this.qxbtn.c066x">系统配置</el-menu-item>
							<el-menu-item index="/manage/wpfx" v-if="this.qxbtn.c037x">物品价格设置</el-menu-item>
							<el-menu-item index="/educa/fxkc" v-if="this.qxbtn.c038x">课程价格设置</el-menu-item>
							<el-menu-item index="/admin/infomode" v-if="this.qxbtn.c067x">通知信息模板</el-menu-item>
						</el-submenu>
						
						<el-submenu  index="5">
							<template slot="title"><i class="el-icon-message"></i>财务模块</template>
							<el-menu-item index="/cost/jfsh" v-if="this.qxbtn.c015x">缴费审核</el-menu-item>
							<el-menu-item index="/cost/student-free" v-if="this.qxbtn.c016x">退费审核</el-menu-item>
							<el-menu-item index="/cost/zcfy" v-if="this.qxbtn.c017x">支出费用登记</el-menu-item>
							<el-menu-item index="/admin/teacherjs" v-if="this.qxbtn.c018x">老师课时结算</el-menu-item>
							<el-menu-item index="/cost/ddlb" >订单列表</el-menu-item>
							<!--<el-menu-item index="/cost/shouzhils" v-if="this.qxbtn.c019x">收支流水</el-menu-item>-->
						</el-submenu>
						
						<el-submenu index="6">
							<template slot="title"><i class="el-icon-date"></i>统计分析</template>
							<el-menu-item index="/statistics/xslstj" v-if="this.qxbtn.c039x">流失统计</el-menu-item>
							<!--<el-menu-item index="/statistics/persontj" v-if="this.qxbtn.c042x">人数统计</el-menu-item>-->
							<el-menu-item index="/statistics/kqtj" v-if="this.qxbtn.c043x">考勤统计</el-menu-item>
							<el-menu-item index="/statistics/srtj" v-if="this.qxbtn.c044x">趋势分析</el-menu-item>
							<el-menu-item index="/statistics/fxzz" v-if="">分校总账</el-menu-item>
							
							<!--<el-menu-item index="/statistics/zctj" v-if="this.qxbtn.c045x">支出统计</el-menu-item>-->
							<!--<el-menu-item index="/statistics/cwrb" v-if="this.qxbtn.c063x">财务日报</el-menu-item>-->
							<el-menu-item index="/educa/kscjtj" v-if="this.qxbtn.c041x">考试成绩统计</el-menu-item>
							<el-menu-item index="/admin/xsda" v-if="this.qxbtn.c003x">学生档案</el-menu-item>
						</el-submenu>
						
						<el-submenu index="7">
							<template slot="title"><i class="el-icon-printer"></i>招生营销</template>
							<el-menu-item index="/Marketing/syzl" v-if="">生源资料</el-menu-item>
							<el-menu-item index="/Marketing/zlk" v-if="">资料库</el-menu-item>
							<el-menu-item index="/Marketing/yymd" v-if="">预约名单</el-menu-item>
							<el-menu-item index="/Marketing/xwzl" v-if="">新闻资料</el-menu-item>
							<el-menu-item index="/Marketing/jlzx" v-if="">交流中心</el-menu-item>
							<el-menu-item index="/Marketing/yxpz" v-if="">营销配置</el-menu-item>
						</el-submenu>
					
					
					<!--<el-submenu :index="item.index" v-for="(item,index) in items">
						<template slot="title"><i :class="item.tb"></i>{{item.content}}</template>

						<el-submenu :index="v.index" v-for="v in item.list" v-if="v.children">
							<template slot="title">{{v.content}}</template>
							<el-menu-item :index="listV.index" v-for="listV in v.children" v-if="listV.isshow=='true'">{{listV.content}}</el-menu-item>
						</el-submenu>
						<el-menu-item :index="v.index" v-else>{{v.content}}</el-menu-item>
					</el-submenu>-->
				</el-menu>
			</el-col>
		</div>

		<!-- <main class="main"> -->
		<main v-bind:class="{'main':this.$store.state.gnlist.pcqh,'main1':!this.$store.state.gnlist.pcqh}">

			<!-- <button type="button" name="button" @click="but">按钮</button>
			<button type="button" name="button" @click="but1">按钮2</button> -->
			<router-view></router-view>
			<titleComponent :title="title" class="title"></titleComponent>
		</main>
	</div>
</template>
<script type="text/javascript">
	import titleComponent from './title'
	import { mapState } from 'vuex'
	export default {
		data() {
			return {
				qxbtn:{
					//行政模块
					c001x:false,
					c002x:false,
					c003x:false,
					c004x:false,
					c006x:false,
					c007x:false,
					c008x:false,
					c047x:false,
					c049x:false,
					c061x:false,
					c062x:false,
					//教务模块
					c009x:false,
					c010x:false,
					c011x:false,
					c013x:false,
					c014x:false,
					c046x:false,
					c048x:false,
					//进销存模块
					c064x:false,
					c020x:false,
					c021x:false,
					c022x:false,
					c065x:false,
					//基础设置
					c030x:false,
					c031x:false,
					c032x:false,
					c033x:false,
					c034x:false,
					c035x:false,
					c036x:false,
					c037x:false,
					c038x:false,
					c066x:false,
					c067x:false,
					//财务模块
					c015x:false,
					c016x:false,
					c017x:false,
					c018x:false,
					c019x:false,
					//统计分析
					c039x:false,
					c041x:false,
					c042x:false,
					c043x:false,
					c044x:false,
					c045x:false,
					c063x:false,
				},
				// class1:true,
				// class2:false,
				// class3:true,
				// class4:false,
				isSelected: 0,
				items: this.$store.state.slidebarList,
				// styleObject:block,
			}
		},
		created () {
				 var logininfo = JSON.parse(localStorage.logininfo) ;
				 //行政模块
                 this.qxbtn.c001x = (logininfo.auth.indexOf("c001x")!=-1);
                 this.qxbtn.c002x = (logininfo.auth.indexOf("c002x")!=-1);
                 this.qxbtn.c003x = (logininfo.auth.indexOf("c003x")!=-1);
                 this.qxbtn.c004x = (logininfo.auth.indexOf("c004x")!=-1);
                 this.qxbtn.c006x = (logininfo.auth.indexOf("c006x")!=-1);
                 this.qxbtn.c007x = (logininfo.auth.indexOf("c007x")!=-1);
                 this.qxbtn.c008x = (logininfo.auth.indexOf("c008x")!=-1);
                 this.qxbtn.c047x = (logininfo.auth.indexOf("c047x")!=-1);
                 this.qxbtn.c049x = (logininfo.auth.indexOf("c049x")!=-1);
                 this.qxbtn.c061x = (logininfo.auth.indexOf("c061x")!=-1);
                 this.qxbtn.c062x = (logininfo.auth.indexOf("c062x")!=-1);
                 //教务模块
                 this.qxbtn.c009x = (logininfo.auth.indexOf("c009x")!=-1);
                 this.qxbtn.c010x = (logininfo.auth.indexOf("c010x")!=-1);
                 this.qxbtn.c011x = (logininfo.auth.indexOf("c011x")!=-1);
                 this.qxbtn.c013x = (logininfo.auth.indexOf("c013x")!=-1);
                 this.qxbtn.c014x = (logininfo.auth.indexOf("c014x")!=-1);
                 this.qxbtn.c046x = (logininfo.auth.indexOf("c046x")!=-1);
                 this.qxbtn.c048x = (logininfo.auth.indexOf("c048x")!=-1);
                 //进销存模块
                 this.qxbtn.c020x = (logininfo.auth.indexOf("c020x")!=-1);
                 this.qxbtn.c064x = (logininfo.auth.indexOf("c064x")!=-1);
                 this.qxbtn.c021x = (logininfo.auth.indexOf("c021x")!=-1);
                 this.qxbtn.c022x = (logininfo.auth.indexOf("c022x")!=-1);
                 this.qxbtn.c065x = (logininfo.auth.indexOf("c065x")!=-1);
                 //基础设置
                 this.qxbtn.c030x = (logininfo.auth.indexOf("c030x")!=-1);
                 this.qxbtn.c031x = (logininfo.auth.indexOf("c031x")!=-1);
                 this.qxbtn.c032x = (logininfo.auth.indexOf("c032x")!=-1);
                 this.qxbtn.c033x = (logininfo.auth.indexOf("c033x")!=-1);
                 this.qxbtn.c034x = (logininfo.auth.indexOf("c034x")!=-1);
                 this.qxbtn.c035x = (logininfo.auth.indexOf("c035x")!=-1);
                 this.qxbtn.c036x = (logininfo.auth.indexOf("c036x")!=-1);
                 this.qxbtn.c037x = (logininfo.auth.indexOf("c037x")!=-1);
                 this.qxbtn.c038x = (logininfo.auth.indexOf("c038x")!=-1);
                 this.qxbtn.c066x = (logininfo.auth.indexOf("c066x")!=-1);
                 this.qxbtn.c067x = (logininfo.auth.indexOf("c067x")!=-1);
                  //财务模块
                 this.qxbtn.c015x = (logininfo.auth.indexOf("c015x")!=-1);
                 this.qxbtn.c016x = (logininfo.auth.indexOf("c016x")!=-1);
                 this.qxbtn.c017x = (logininfo.auth.indexOf("c017x")!=-1);
                 this.qxbtn.c018x = (logininfo.auth.indexOf("c018x")!=-1);
                 this.qxbtn.c019x = (logininfo.auth.indexOf("c019x")!=-1);
                 //统计分析
                 this.qxbtn.c039x = (logininfo.auth.indexOf("c039x")!=-1);
                 this.qxbtn.c041x = (logininfo.auth.indexOf("c041x")!=-1);
                 this.qxbtn.c042x = (logininfo.auth.indexOf("c042x")!=-1);
                 this.qxbtn.c043x = (logininfo.auth.indexOf("c043x")!=-1);
                 this.qxbtn.c044x = (logininfo.auth.indexOf("c044x")!=-1);
                 this.qxbtn.c045x = (logininfo.auth.indexOf("c045x")!=-1);
                 this.qxbtn.c063x = (logininfo.auth.indexOf("c063x")!=-1);
//			this.items= this.$store.state.slidebarList;
//			for(var v in this.item.list){
//				for(var m in v){
//					m.isshow='';
//				}
//			}
		},
		methods: {
			// but(){
			// 	this.class1=false;
			// 	this.class2=true
			// 	this.class3=false
			// 	this.class4=true
			// },
			// but1(){
			// 	this.class1=true;
			// 	this.class2=false
			// 	this.class3=true
			// 	this.class4=false
			// }
		},
		components: { titleComponent },
		computed: {

			routerIndex() {
				return this.$store.state.routerIndex;
			},
			...mapState([
				'title',
			])
		}
	}
</script>

<style lang="less" scoped>
	.header {
		width: 100%;
		height: 100%;
		.left-sildebar {
			width: 13.5%;
			height: 100%;
			padding-top: 55px;
			overflow: auto;
			float: left;
			/*top:55px;left:0;*/
			background: #33485C;
			z-index: 999;
			// display: block;
		}
		.left-sildebar1 {
			display: none;
		}
		.main {
			width: 86%;
			height: 100%;
			padding: 50px 20px 10px 20px;
			padding-top: 100px;
			float: right;
			background: #E8EDF0;
			overflow: auto;
			position: relative;
			.title {
				width: 86%;
				position:fixed;
				top: 55px;
				right: 0;
				z-index: 99;
			}
		}
		.main1 {
			width: 100%;
			height: 100%;
			padding: 50px 20px 10px 20px;
			padding-top: 100px;
			float: right;
			background: #E8EDF0;
			overflow: auto;
			position: relative;
			.title {
				width: 100%;
				float: left;
				position: absolute;
				top: 55px;
				left: 0;
				z-index: 99;
			}
		}

	}
</style>
